﻿<%@ Control Language="C#" AutoEventWireup="true" CodeFile="CreateEmployee.ascx.cs" Inherits="Admin_Components_Permission_CreateEmployee" %>
<%@ Register Assembly="Telerik.Web.UI" Namespace="Telerik.Web.UI" TagPrefix="telerik" %>
<%@ Register Assembly="AjaxControlToolkit" Namespace="AjaxControlToolkit" TagPrefix="ajaxToolkit" %>
<telerik:RadScriptManager ID="ScriptManager2" runat="server" EnableTheming="True">
</telerik:RadScriptManager>
<asp:UpdatePanel ID="UpdatePanel1" runat="server">
    <ContentTemplate>
        <telerik:RadTabStrip ID="TabStrip1" runat="server" EnableDragToReorder="true" Skin="Vista" MultiPageID="RadMultiPag1" SelectedIndex="1">
            <Tabs>
                <telerik:RadTab Text="THÔNG TIN NHÂN VIÊN" Selected="True">
                </telerik:RadTab>
                 <telerik:RadTab Text="TÌM KIẾM">
                </telerik:RadTab>
            </Tabs>
        </telerik:RadTabStrip>
        <!--Thong tin nhan vien -->
         <telerik:RadMultiPage ID="RadMultiPag1" runat="server" SelectedIndex="0">
             <telerik:RadPageView ID="RadPageView1" runat="server" Height="330px" Style="overflow: hidden">
                 <fieldset class="form" id="fsGeneral">
                  <br />
                <div class="form-horizontal wrapper-center clearfix">
                    <!--Block bên trái -->
                 <div class="form-group col-md-6">
                  <!--Dòng -->
                     
                    <div class="form-group">
                        <label class="col-md-3 control-label">
                            Tên nhân viên <span style="color:red;">(*)</span></label>
                        <div class="col-md-4">
                            <telerik:RadTextBox ID="txtEmployeeName" CssClass="col-imp-12 inputForm" runat="server" />
                            <asp:RequiredFieldValidator  ID="RequiredFieldValidator1" runat="server" ControlToValidate="txtEmployeeName" ValidationGroup="g1"
                           ErrorMessage="" ></asp:RequiredFieldValidator>
                        </div>
                        
                        <label class="col-md-2 control-label star">Tỉnh thành</label>
                        <div class="col-md-3">
                            <telerik:RadComboBox ID="cboProvince" runat="server" CssClass="col-imp-12" OnSelectedIndexChanged="cboProvince_SelectedIndexChanged" AutoPostBack="true">  
                            </telerik:RadComboBox>
                            <asp:RequiredFieldValidator  ID="cboProvinceRequired" runat="server" ControlToValidate="cboProvince" ValidationGroup="g1"
                           ErrorMessage="" InitialValue="---Chọn---"></asp:RequiredFieldValidator>
                         </div>
                    </div>
                                      
                  <!--End Dòng -->
                     <!--Dòng -->
                    <div class="form-group">
                        <label class="col-md-3 control-label">
                            Vai trò <span style="color:red;">(*)</span></label>
                        <div class="col-md-4">
                            <telerik:RadComboBox ID="cboRole" runat="server" CssClass="col-imp-12" OnSelectedIndexChanged="cboRole_SelectedIndexChanged" AutoPostBack="true">
                            </telerik:RadComboBox>
                            <asp:RequiredFieldValidator  ID="RequiredFieldValidator3" runat="server" ControlToValidate="cboRole" ValidationGroup="g1"
                           ErrorMessage="" InitialValue="--Chọn--" ></asp:RequiredFieldValidator>
                        </div>
                        <label class="col-md-2 control-label">Tạo user</label>
                        <div class="col-md-3">
                            <telerik:RadComboBox ID="cboCreateUser" runat="server" CssClass="col-imp-12" OnSelectedIndexChanged="cboCreateUser_SelectedIndexChanged" AutoPostBack="true">  
                            </telerik:RadComboBox>
                         </div>
                    </div>
                  <!--End Dòng -->
                 <!--Dòng -->
                    <div class="form-group">
                        <label class="col-md-3 control-label">
                            Cửa hàng <span style="color:red;">(*)</span></label>
                        <div class="col-md-4">
                            <telerik:RadComboBox ID="cboShop" runat="server" CssClass="col-imp-12">
                            </telerik:RadComboBox>
                             <asp:RequiredFieldValidator  ID="ShopRequired" runat="server" ControlToValidate="cboShop" ValidationGroup="g1"
                           ErrorMessage="" InitialValue="--Chọn--" ></asp:RequiredFieldValidator>
                        </div>
                         <label class="col-md-2 control-label">Điện thoại</label>
                        <div class="col-md-3">
                             <telerik:RadTextBox ID="txtPhoneEmp" CssClass="col-imp-12 inputForm" runat="server" />
                         </div>
                    </div>
                  <!--End Dòng -->
                    <!--Dòng -->
                    <div class="form-group">
                        <label class="col-md-3 control-label">
                            Địa chỉ</label>
                        <div class="col-md-9">
                            <telerik:RadTextBox ID="txtAddress" CssClass="col-imp-12 inputForm" runat="server" />
                        </div>
                    </div>
                  <!--End Dòng -->
                 <div class="form-group">
                    <label class="col-md-3 control-label">
                      Tên đăng nhập <span style="color:red;">(*)</span></label>
                    <div class="col-md-4">
                        <telerik:RadTextBox ID="txtUserName" CssClass="col-imp-12 inputForm" runat="server" />
                        <asp:RequiredFieldValidator  ID="RequiredFieldValidator2" runat="server" ControlToValidate="txtUserName" ValidationGroup="g1"
                        ErrorMessage="" ></asp:RequiredFieldValidator>
                    </div>
                        
                    <label class="col-md-2 control-label">
                        Mật khẩu</label>
                    <div class="col-md-3">
                        <telerik:RadTextBox ID="txtPassword" CssClass="col-imp-12 inputForm" runat="server" readonly="true" />
                    </div>
                </div>
                </div>
                 <!--End Block bên trái -->
                     <!--Block bên phải -->
                <div class="form-group col-md-6">
                    <div class="form-group">
                        
                        <label class="col-md-3 control-label">Ngày vào làm</label>
                        <div class="col-md-3">
                          <telerik:RadDatePicker ID="dtpWorkDate" cssclass="col-imp-12" enabled="true" runat="server">
                                <Calendar ID="Calendar1" runat="server" EnableKeyboardNavigation="true" ViewSelectorText="x" Skin="Hay" UseRowHeadersAsSelectors="False" UseColumnHeadersAsSelectors="False">
                                </Calendar>
                                <DateInput Enabled="False" style="width:200px" DisplayDateFormat="dd/MM/yyyy" DateFormat="dd/MM/yyyy"></DateInput>
                            </telerik:RadDatePicker>
                         </div>
                        <label class="col-md-2 control-label">
                            Mã NV</label>
                        <div class="col-md-3">
                            <telerik:RadTextBox ID="txtEmployeeCode" CssClass="col-imp-12 inputForm" runat="server" Readonly="true"/>
                        </div>
                  
                    </div>
                    
                    <div class="form-group">
                        <label class="col-md-3 control-label">Email</label>
                        <div class="col-md-8">
                             <telerik:RadTextBox ID="txtEmail" CssClass="col-imp-12 inputForm" runat="server" />
                         </div>

                    </div>
                     <div class="form-group">
                        
                        <label class="col-md-3 control-label">Là NV tư vấn</label>
                        <div class="col-md-3">
                             <telerik:RadComboBox ID="cboIsAdvisor" runat="server" CssClass="col-imp-12" OnSelectedIndexChanged="cboIsAdvisor_SelectedIndexChanged" AutoPostBack="true">
                            </telerik:RadComboBox>
                         </div>
                        <label class="col-md-2 control-label">Yahoo</label>
                        <div class="col-md-3">
                             <telerik:RadTextBox ID="txtYahoo" CssClass="col-imp-12 inputForm" runat="server" />
                         </div>
                        
                    </div>
                    <div class="form-group">
                        
                        <label class="col-md-3 control-label">Điện thoại tư vấn</label>
                        <div class="col-md-3">
                            <telerik:RadTextBox ID="txtPhoneComp" CssClass="col-imp-12 inputForm" runat="server" />
                         </div>
                        <label class="col-md-2 control-label">Skype</label>
                        <div class="col-md-3">
                             <telerik:RadTextBox ID="txtSkype" CssClass="col-imp-12 inputForm" runat="server" />
                         </div>
                        
                    </div>
                    <div class="form-group">
                    <label class="col-md-3 control-label">
                            CMND</label>
                        <div class="col-md-3">
                            <telerik:RadTextBox ID="txtIDCard" CssClass="col-imp-12 inputForm" runat="server" />
                        </div>
                    </div>
                </div>
                 <!--End Block bên phải -->
                </div>
                      <!--Action-->
                    <div class="set-btns text-center">
                        <asp:Button ID="btnSave" CssClass="btn btn-sm btn-primary" runat="server" Text="Lưu" OnClick="btnSave_Click" ValidationGroup="g1" OnClientClick="fnOnUpdateValidators('g1');"/>
                        <asp:Button ID="btnReset" runat="server" CssClass="btn btn-sm btn-primary" Text="Tạo mới" OnClick="btnReset_Click"/>
                    </div>

                    <!--End Action -->
                </fieldset>
            </telerik:RadPageView>

             <!--Tim kiem -->
             <telerik:RadPageView ID="RadPageView2" runat="server" Height="210px" Style="overflow: hidden">
                 <fieldset class="form" id="Fieldset1">
                  <br />
                <div class="form-horizontal wrapper-center clearfix">
                    <!--Block bên trái -->
                 <div class="form-group col-md-6">
                  <!--Dòng -->
                     
                    <div class="form-group">
                        <label class="col-md-3 control-label">
                            Tên nhân viên </label>
                        <div class="col-md-4">
                            <telerik:RadTextBox ID="txtEmployeeNameSearch" CssClass="col-imp-12 inputForm" runat="server" />
                        </div>
                        <label class="col-md-2 control-label">
                            Mã NV</label>
                        <div class="col-md-3">
                            <telerik:RadTextBox ID="txtEmployeeCodeSearch" CssClass="col-imp-12 inputForm" runat="server"/>
                        </div>
                    </div>
                                      
                  <!--End Dòng -->
                     <!--Dòng -->
                    <div class="form-group">
                         <label class="col-md-3 control-label">Tên đăng nhập</label>
                        <div class="col-md-4">
                            <telerik:RadTextBox ID="txtUserNameSearch" CssClass="col-imp-12 inputForm" runat="server" />
                        </div>
                        <label class="col-md-2 control-label">Điện thoại</label>
                        <div class="col-md-3">
                             <telerik:RadTextBox ID="txtPhoneEmpSearch" CssClass="col-imp-12 inputForm" runat="server" />
                         </div>
                        
                    </div>
                  <!--End Dòng -->
                 

                </div>
                 <!--End Block bên trái -->
                <!--Block bên phải -->
                <!--Dòng -->
                 <div class="form-group">
                         <label class="col-md-2 control-label star">Tỉnh thành</label>
                        <div class="col-md-4">
                            <telerik:RadComboBox ID="cboProvinceIDsearch" runat="server" CssClass="col-imp-7" OnSelectedIndexChanged="cboProvinceIDSearch_SelectedIndexChanged" AutoPostBack="true">  
                            </telerik:RadComboBox>
                         </div>
                        <label class="col-md-2 control-label">
                            Cửa hàng</label>
                        <div class="col-md-4">
                            <telerik:RadComboBox ID="cboShopSearch" runat="server" CssClass="col-imp-7">
                            </telerik:RadComboBox>
                        </div>
                         <label class="col-md-2 control-label">
                            Vai trò</label>
                        <div class="col-md-4">
                            <telerik:RadComboBox ID="cboRoleSearch" runat="server" CssClass="col-imp-7">
                            </telerik:RadComboBox>
                        </div>
                       
                    </div>
                  <!--End Dòng -->
                </div>
                 <!--End Block bên phải -->
                
                  <!--Action-->
                <div class="set-btns text-center">
                    <asp:Button ID="btnSearch" CssClass="btn btn-sm btn-primary" runat="server" Text="Tìm kiếm" OnClick="btnSearch_Click"/>
                </div>

                    <!--End Action -->
                </fieldset>
            </telerik:RadPageView>
         </telerik:RadMultiPage>
        <div class="row">
               <telerik:radgrid id="gv" runat="server" cellspacing="0" cssclass=" table table-bordered"
                    AllowPaging="true"
                    PageSize="50" AllowCustomPaging="true" OnNeedDataSource="gv_NeedDataSource" 
                    gridlines="None" autogeneratecolumns="False" headerstyle-horizontalalign="Center" OnItemCommand="gv_ItemCommand"
                    allowmultirowselection="True" headerstyle-borderstyle="None">
                    <MasterTableView ShowHeader="true" NoMasterRecordsText="Không có dữ liệu." ShowGroupFooter="true" EditMode="InPlace"  PageSize="50">
                        <Columns>
                            <telerik:GridTemplateColumn HeaderText="STT" HeaderButtonType="TextButton" ItemStyle-HorizontalAlign="Center">
                                <ItemTemplate>
                                    <%# Container.ItemIndex + 1 %></ItemTemplate>
                                <HeaderStyle Width="50px" />
                                <ItemStyle HorizontalAlign="Center" />
                            </telerik:GridTemplateColumn>
                            <telerik:GridBoundColumn  HeaderStyle-HorizontalAlign="Center" ItemStyle-HorizontalAlign="Center"
                                    UniqueName="EmployeeID" DataField="EmployeeID" Display="false">
                                <HeaderStyle HorizontalAlign="Center"></HeaderStyle>
                                <ItemStyle HorizontalAlign="Center"></ItemStyle>
                            </telerik:GridBoundColumn>
                            <telerik:GridBoundColumn  HeaderStyle-HorizontalAlign="Center" ItemStyle-HorizontalAlign="Center"
                                    UniqueName="EmployeeCode" DataField="EmployeeCode" HeaderText="Mã NV">
                                <HeaderStyle HorizontalAlign="Center" Width="70px" />
                                <ItemStyle HorizontalAlign="Center"  Width="70px"/>
                            </telerik:GridBoundColumn>

                            <telerik:GridBoundColumn  HeaderStyle-HorizontalAlign="Center" ItemStyle-HorizontalAlign="Center"
                                 UniqueName="EmployeeName" DataField="EmployeeName"  HeaderText="Tên NV">
                                <HeaderStyle HorizontalAlign="Center" Width="170px" />
                                <ItemStyle HorizontalAlign="Center"  Width="170px"/>
                            </telerik:GridBoundColumn>
                            <telerik:GridBoundColumn  HeaderStyle-HorizontalAlign="Center" ItemStyle-HorizontalAlign="Center"
                                 UniqueName="Shop" DataField="Shop"  HeaderText="Cửa hàng" >
                                <HeaderStyle HorizontalAlign="Center" Width="150px" />
                                <ItemStyle HorizontalAlign="Center"  Width="150px"/>
                            </telerik:GridBoundColumn>
                            <telerik:GridBoundColumn  HeaderStyle-HorizontalAlign="Center" ItemStyle-HorizontalAlign="Center"
                                 UniqueName="Role" DataField="Role"  HeaderText="Vai trò" >
                                   <HeaderStyle HorizontalAlign="Center" Width="100px" />
                                   <ItemStyle HorizontalAlign="Center"  Width="100px"/>
                            </telerik:GridBoundColumn>
                            <telerik:GridBoundColumn  HeaderStyle-HorizontalAlign="Center" ItemStyle-HorizontalAlign="Center"
                                 UniqueName="UserName" DataField="UserName"  HeaderText="Tên đăng nhập">
                                 <HeaderStyle HorizontalAlign="Center" Width="100px" />
                                <ItemStyle HorizontalAlign="Center"  Width="100px"/>
                            </telerik:GridBoundColumn>
                            <telerik:GridTemplateColumn HeaderText="Xóa" Visible=true HeaderButtonType="TextButton" ItemStyle-HorizontalAlign="Center">
                                <ItemTemplate>
                                    <asp:Button ID="btnDelete" CssClass="btnX" CommandArgument='<%# Eval("EmployeeID") %>'
                                        OnClientClick="return ConfirmOnDelete('Bạn chắc chắn muốn xóa?')" CommandName="EditDelItem"
                                        runat="server"></asp:Button>
                                </ItemTemplate>
                                <HeaderStyle Width="30px"/>
                               <ItemStyle HorizontalAlign="Center" />
                            </telerik:GridTemplateColumn>
                            <telerik:GridTemplateColumn  HeaderText="Chi tiết" HeaderButtonType="TextButton" ItemStyle-HorizontalAlign="Center">
                            <ItemTemplate>
                                <asp:Button ID="btnDetail" runat="server" CssClass="btnViewDetail" CommandArgument='<%# Eval("EmployeeID") %>'
                                    CommandName="DetailItem" Target="_blank"/>
                            </ItemTemplate>
                            <HeaderStyle HorizontalAlign="Center" Width="30px" />
                            <ItemStyle HorizontalAlign="Center" />
                        </telerik:GridTemplateColumn>
                        <telerik:GridBoundColumn  HeaderStyle-HorizontalAlign="Center" ItemStyle-HorizontalAlign="Center"
                            UniqueName="StatusCode" DataField="StatusCode" Display="false">
                        <HeaderStyle HorizontalAlign="Center"></HeaderStyle>
                        <ItemStyle HorizontalAlign="Center"></ItemStyle>
                    </telerik:GridBoundColumn>
                        </Columns>
                    </MasterTableView>
               </telerik:radgrid>
             </div>
    </ContentTemplate>
</asp:UpdatePanel>

<div class="progressbar">
    <asp:UpdateProgress ID="up" runat="server" AssociatedUpdatePanelID="UpdatePanel1">
        <ProgressTemplate>
            <div class="bg">
                <div class="progress progress-striped active">
                    <div class="progress-bar" role="progressbar" aria-valuenow="45" aria-valuemin="0"
                        aria-valuemax="100" style="width: 100%">
                        <span class="sr-only">100% Complete</span>
                    </div>
                </div>
            </div>
        </ProgressTemplate>
    </asp:UpdateProgress>
</div>